#ifndef _SPIDEV_INTERFACE_
#define _SPIDEV_INTERFACE_

#include "common.h"
#include <stddef.h>
#include <sys/ioctl.h>
#include <linux/ioctl.h>
#include <sys/stat.h>
#include <linux/types.h>
#include <linux/spi/spidev.h>

int init_spi(char const *dev_name);
int set_spi_mode(int fd, uint32_t mode, int8_t bits, uint32_t speed);
int close_spi(int fd);
void transfer(int fd, uint8_t const *tx, uint8_t const *rx, size_t len);

#endif // #ifdef _SPIDEV_INTERFACE_
